<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xmlns:th="http://www.thymeleaf.org">
<head><title>
	哗啦啦
</title>
	<link href="/frontend_css/base.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="/scripts/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="/scripts/js.js"></script>
    <style type="text/css">
    	.analysisTable tr td.issueend{ width:120px;}
    </style>
</head>
<body>
    <form method="post" th:action="${'/fgame/'+game.id+'/trendchart'}" id="form1">
    <div>
    <table border="0"  style="width: 700px; margin: 0px auto 0px auto">
    <tr>
	    <td align="left">
	    <h1>
	        <span id="Label1">幸运28</span>走势图</h1>
	    </td>
	    <td align="right">
	    	<input type="hidden" id="serverTime" th:value="${serverTime}"/>
	    	<input type="hidden" id="lotteryTime" th:value="${to_be_lottery_time}"/>
	    	<span id="topTime">离<font id="timeIssue" class="l1" style="color: #800000" th:text="${period}">30035095</font>期开奖还有<font id="timeSec" class="sec" style="color: #DD5800"></font>秒</span>
	    </td>
	</tr>
    <tr>
	    <td align="left">
			期数：<input name="num" type="text" th:value="${num}" value="100" id="TextBox1" />
	    	<input type="submit" name="Button1" value="查询" id="Button1" /><font style="color: #808080">最多2000期</font>
	    </td>
	    <td align="right">
	        <a href="javascript:refreshsi();" class="s1">关自动刷新</a>
	        <a href="javascript:refreshsi();" class="s2" style=" display:none;">开自动刷新</a>
	    </td>
    </tr>
    </table>

<div>
	<table class="analysisTable" cellspacing="1" cellpadding="0" id="GridView1">
		<tr>
			<td class="issueNum">标准间隔</td>
			<td th:each="odd:${odds}" th:text="${odd.standardInterval}">1000</td>
			<td th:each="htimes:${headRightTimes}"></td>
		</tr>
		<tr>
			<td class="issueNum">实际间隔</td>
			<td th:each="real:${realInterval}" th:class="${(real>(odds.get(realStat.index).standardInterval))?'overStand':''}" th:text="${real}">99</td>
			<td th:each="htimes:${headRightTimes}"></td>
		</tr>
		<tr>
			<td class="issueNum">标准次数</td>
			<td th:each="odd:${odds}" th:text="${odd.standardTimes}">0</td>
			<td th:each="htimes:${headRightTimes}"></td>
		</tr>
		<tr>
			<td class="issueNum">实际次数</td>
			<td th:each="realt:${realTimes}"  th:class="${(realt&lt;(odds.get(realtStat.index).standardTimes))?'overStand':''}" th:text="${realt}">0</td>
			<td th:each="htimes:${headRightTimes}" th:text="${htimes}"></td>
		</tr><tr class="issueHeader">
			<td class="issueNum">期数</td>
			<td th:each="odd:${odds}" th:text="${odd.number}">0</td>
			<td th:each="headr:${headRight}" th:text="${headr}"></td>
		</tr>
		<tr th:each="p:${periods}">
			<td class="issueNum" th:text="${p.period}">30035094</td>
			<td th:each="odd:${odds}" th:text="${odd.number == p.resultNumber ?odd.number:''}" th:class="${odd.number == p.resultNumber ?((odd.number &gt;low_side &amp;&amp; odd.number &lt; super_side)?'red':'blue'):((odd.number &gt;low_side &amp;&amp; odd.number &lt; super_side)?'center':'side')}"> </td>
			
			<th:block th:if="${p.even}">
			<td></td><td class="pink">双</td>
			</th:block>
			<th:block th:if="${!p.even}">
			<td class="green">单</td><td></td>
			</th:block>
			
			<th:block th:if="${!p.big}">
			<td></td><td class="yellow">小</td>
			</th:block>
			<th:block th:if="${p.big}">
			<td class="red">大</td><td></td>
			</th:block>
			
			
			<th:block th:if="${p.side}">
			<td></td><td class="purple">边</td>
			</th:block>
			<th:block th:if="${!p.side}">
			<td class="blue">中</td><td></td>
			</th:block>
			
			<th:block th:if="${!p.big_tail}">
			<td></td><td class="green" th:text="${p.resultNumber%10}"></td>
			</th:block>
			<th:block th:if="${p.big_tail}">
			<td class="red" th:text="${p.resultNumber%10}"></td><td></td>
			</th:block>
			
			<td th:text="${p.resultNumber%3}">2</td>
			<td th:text="${p.resultNumber%4}">0</td>
			<td th:text="${p.resultNumber%5}">0</td>
			<td class="issueend" th:text="${#dates.format(p.lotteryTime,'MM-dd HH:mm:ss')}"></td>
		</tr>
	</table>
</div>
    
    </div>
    </form>
<script type="text/javascript">
var refresh = getCookie('refreshswitchz');
if (refresh == null || refresh == "") {
    setCookie('refreshswitchz', 1, 365);
    refresh = 1;
}

if (refresh == 0) { $(".s2").css("display", "block"); $(".s1").css("display", "none"); }
if (refresh == 1) { $(".s2").css("display", "none"); $(".s1").css("display", "block"); } 

var serverTime = $('#serverTime').val();
var endTime = $('#lotteryTime').val();
var timeIssue2 = $('#timeIssue').html(); //期号
var sec; //还剩秒数
var timeFlag; //时间倒数对象
var Rsec = 0;

function SetRunTime() {
    $("#timeSec").text(parseInt($("#timeSec").text()) - 1);
    if (parseInt($("#timeSec").text()) == 0) {
        window.clearInterval(timeFlag);
        $("#topTime").html("正在开奖,请刷新页面..."); 
        if (refresh == 1) {
            timeFlag = window.setInterval(FunRefresh, 1000);
        }
    }
}
function DoRunTime() {
    if ($.fn.CompareTime(endTime, serverTime)) {
        sec = $.fn.GetTimeCSecond(endTime, serverTime);
        $("#timeSec").text(sec);
        timeFlag = window.setInterval(SetRunTime, 1000);
    } else {
        $("#topTime").html("正在开奖,请刷新页面");
        if (refresh == 1) {
            timeFlag = window.setInterval(FunRefresh, 1000);
        }
    }
}
function FunRefresh() {
    Rsec += 1; 
    if (Rsec == 4) {
        window.location.href = window.location.href;
    }
}
function refreshsi() {
    if (refresh == 1) {
        refresh = 0;
        $(".s2").css("display", "block"); $(".s1").css("display", "none");
    }
    else {
        refresh = 1;
        $(".s2").css("display", "none"); $(".s1").css("display", "block");
    }
    setCookie('refreshswitchz', refresh, 365);
} 
DoRunTime();
</script>
</body>
</html>

